﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.Model;
using System.Data;
using GtsServer.DAL;
using GtsServer.Common;

namespace GtsServer.Manage.Controller
{
    public class TaskPrizeController
    {
        TaskPrizeDAL dal = new TaskPrizeDAL();
        public List<TaskPrize> GetList(int taskID)
        {
            DataSet ds = dal.GetList(taskID);
            return IListDataSet.DataSetToIList<TaskPrize>(ds, 0).ToList();
        }

        public List<TaskPrizeShow> GetListAndPrizeName(int taskID)
        {
            DataSet ds = dal.GetListAndPrizeName(taskID);
            return IListDataSet.DataSetToIList<TaskPrizeShow>(ds, 0).ToList();
        }

        public int Add(TaskPrize model)
        {
            return dal.Add(model);
        }

        public bool Update(TaskPrize model)
        {
            return dal.Update(model);
        }

        public bool Delete(int id)
        {
            return dal.Delete(id);
        }
    }
}
